<{include file="../common/header.tpl"}>
<table width="100%" border="0" cellspacing="0">
    <tr>
    <td width="13%" valign="top">
        <{include file="../common/left.tpl"}>
    </td>
    <td width="87%" valign="top">
        <table width="100%" border="0" cellspacing="0">
            <tr>
                <td>
                <div class="subnav">
                        <div class="content-menu ib-a blue line-x">
                            <a href="javascript:void(0);" class="on"><em><b><{$question_info.question_name}></b>--网点管理</em></a>
                            <!--<span>|</span><a href="/webadmin/question/add?project_id=<{$project_id}>"><em>添加<b><{$question_info.question_name}></b>网点</em></a><span>|</span>-->
                        </div>
                </div>

                <div class="pad_10">
                <div class="table-list">
                    <form name="form1" id="myform" method="post" action="/webadmin/netquestion/SetStatus" >
                    <table width="100%">
                        <thead>
                            <tr>
                            <th width="5%">全选</th>
                            <th width="5%">网点编号</th>
                            <th width="20%">网点名称</th>
                            <th width="10%">节点状态</th>
                            <th width="15%">更新时间</th>
                            <th width="10%">状态</th>
                            <th width="15%">创建时间</th>
                            <th width="20%">管理操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <{foreach $list as $key => $val}>
                                <tr onMouseOver="this.className = 'tr2'" onMouseOut="this.className = 'tr1'" class="tr1" id="nq_<{$val.nq_id}>">
                                <td><input type="checkbox" name="nq_id[]" value="<{$val.nq_id}>" /></td>
                                <td><{$val.network_num}></td>
                                <td align="center"><{$val.network_name}></td>
                                <td align="center"><a href="javascript:void(0);"><span style=""><{if $auditStatus[$val.audit]}><{$auditStatus[$val.audit]}><{else}>--<{/if}></span></a> </td>
                                <td align="center"><{$val.update_time|date_format:"%Y-%m-%d %H:%M:%S"}></td>
                                <td align="center"><{$netQuestionStatus[$val.status]}></td>
                                <td align="center"><{$val.create_time|date_format:"%Y-%m-%d %H:%M:%S"}></td>
                                <td align="center">
                                    <{if $val.status==1}>
                                    <a href="/webadmin/netQuestion/edit?nq_id=<{$val.nq_id}>" target="_blank">修改</a> | 
                                    <{if $question_info.status==2||$question_info.status==100}><a href="/webadmin/netQuestion/preview?nq_id=<{$val.nq_id}>" target="_blank">预览</a> | <{/if}>
                                    <a href="javascript:void(0);" onclick="del(<{$val.nq_id}>);">删除</a><{if $val.haveattach}> | 
                                    <a href="/webadmin/attach/DownNq?nq_id=<{$val.nq_id}>" target="_blank">下载附件</a><{/if}>
                                    <{/if}>
                                </td>
                                </tr>
                            <{/foreach}>
                            <tr>
                                <td colspan="3"><input type="checkbox" id="che_box" value="" />全选&nbsp;&nbsp;&nbsp;<input type="submit" value="设为完成状态" /></td>
                                <td colspan="5" style="text-align:right;"><{$page}></td>
                            </tr>
                        </tbody>
                    </table>
                    </form>
                </div>
        </div>
        </td>
    </tr>
    </table>
</td>
</tr>
</table>
<script type="text/javascript">
 //删除网点问卷
 function del(nq_id){
     if (confirm('你确定要删除吗？')) {
            $.ajax({
                    type: 'post',
                    async: true,
                    dataType: "json",
                    data: {'nq_id':nq_id},
                    url: '/webadmin/netQuestion/del',
                    success: function (data) {
                        alert(data.note);
                        if (data.status==1) {
                            $('#nq_' + id).remove();
                        }
                    }
            });
    }
 }
 function showRequest(formData, jqForm, options) { 
    return true;
}
function showResponse(responseText, statusText, xhr, $form)  { 
    alert(responseText.note);
    window.location.reload();
}
 $(function(){
    //复选框事件  
    //全选、取消全选的事件  
    $(document).on("click","#che_box",function(){
        var ischecked= $("#che_box:checked").length;

        var $checkboxs =$("input[name='nq_id[]']");
        if(ischecked){
            $checkboxs.prop("checked",true);
        }else{
            $checkboxs.prop("checked",false);
        }
    }); 
    var options = {         
        beforeSubmit:  showRequest,  
        success:       showResponse,
        dataType:  'json'
    }
    $('#myform').ajaxForm(options); 
})
</script>
<{include file="../common/footer.tpl"}>